package chpt06;

public class Apple {
    private int code; // 编号
    private String color; // 颜色
    private int weight; // 重量
    private String origin; // 产地
    // getter/setter代码
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	// 带参数构造器
	public Apple(int code, String color, int weight, String origin) {
		this.code = code;
		this.color = color;
		this.weight = weight;
		this.origin = origin;
	}
	// toString方法
	public String toString() {
		return "Apple [code=" + code + ", color=" + color + ", weight=" + weight + ", origin=" + origin + "]";
	}
}
